// 泛型： 可以使用泛型来创建可重用的组件，一个组件可以支持多种类型的数据。

export function returnFn<T>(params: T) {
	return params
}

const s = returnFn<number>(123)

const str = returnFn<string>('abc')
const arr = returnFn<{ name: string }[]>([{ name: '张安' }])

const bool = returnFn<number>(123);

interface O<T> {
	name: string
	age: T
}

const o: O<number> = {
	name: '张三',
	age: 18
}


const o1: O<string> = {
	name: '张三',
	age: "18"
}



class Person<T, U, Q, W> {
	name: T
	age: U
	sex: Q
	money: W
	constructor(name: T, age: U, sex: Q, money: W) {
		this.name = name
		this.age = age
		this.sex = sex
		this.money = money
	}
}

const p1 = new Person('张三', 18, '男', 10000)
const p2 = new Person('李四', "19", '女', "100000")